/**
 * 北京钉图互动科技 all right reserver
 */
package com.sincebest.fivestar.common.exception;

import java.util.Collections;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.sincebest.fivestar.common.ErrorCodeEntry;

/**
 * 基本错误码常量
 * 
 * @author Wangyi
 * @since 2016年6月24日
 */
public class BaseErrorCodes {

	public static final Logger log = LoggerFactory.getLogger(BaseErrorCodes.class);
	public static final List<ErrorCodeEntry> BASE_ERROR_CODES;

	public static final ErrorCodeEntry UNDEFINED = new ErrorCodeEntry("UNDEFINED", 500, "未定义的错误");
	public static final ErrorCodeEntry CALL_LIMITED = new ErrorCodeEntry("B10", 403, "调用次数超限");
	public static final ErrorCodeEntry MISSING_SIGNATURE = new ErrorCodeEntry("B11", 400, "缺少签名参数sign");
	public static final ErrorCodeEntry INVALID_SIGNATURE = new ErrorCodeEntry("B12", 400, "无效签名");
	public static final ErrorCodeEntry MISSING_TIMESTAMP = new ErrorCodeEntry("B13", 400, "缺少时间戳参数");
	public static final ErrorCodeEntry INVALID_TIMESTAMP = new ErrorCodeEntry("B14", 400, "非法的时间戳参数");
	public static final ErrorCodeEntry DIFFER_TIMESTAMP = new ErrorCodeEntry("B15", 400, "时间戳超出限制");
	public static final ErrorCodeEntry INVALID_VERSION = new ErrorCodeEntry("B16", 400, "非法的版本参数");
	public static final ErrorCodeEntry UNSUPPORTED_VERSION = new ErrorCodeEntry("B17", 400, "不支持的版本号");
	public static final ErrorCodeEntry MISSING_SESSION_TOKEN = new ErrorCodeEntry("B18", 400, "缺少会话token参数");
	public static final ErrorCodeEntry INVALID_SESSION_TOKEN = new ErrorCodeEntry("B19", 401, "无效的会话token参数");
	public static final ErrorCodeEntry HTTP_REQ_NOT_USE_UTF8 = new ErrorCodeEntry("B20", 400, "HTTP请求没用使用UTF-8编码");
	public static final ErrorCodeEntry MISSING_REQUIRED_ARGS = new ErrorCodeEntry("B21", 400, "缺少必选参数");
	public static final ErrorCodeEntry INVALID_ARGS = new ErrorCodeEntry("B22", 400, "非法参数");
	public static final ErrorCodeEntry REMOTE_SERVICE_ERROR = new ErrorCodeEntry("B23", 503, "连接远程服务错误");
	public static final ErrorCodeEntry REMOTE_SERVICE_TIMEOUT = new ErrorCodeEntry("B24", 504, "连接远程服务超时");
	public static final ErrorCodeEntry SERVICE_UNAVAILABLE = new ErrorCodeEntry("B25", 503, "服务不可用");
	public static final ErrorCodeEntry DATA_STORE_CONNECT_FAIL = new ErrorCodeEntry("B26", 503, "数据存储连接失败");
	public static final ErrorCodeEntry DATA_ACCESS_ERROR = new ErrorCodeEntry("B27", 503, "数据访问错误");
	public static final ErrorCodeEntry NETWORK_CONNECT_ERROR = new ErrorCodeEntry("B28", 503, "网络连接错误");
	public static final ErrorCodeEntry REQ_ARGS_BIND_ERROR = new ErrorCodeEntry("B29", 400, "请求参数绑定错误");
	public static final ErrorCodeEntry ALI_CLIENT_ERROR = new ErrorCodeEntry("B30", 503, "阿里客户端调用错误");
	public static final ErrorCodeEntry ARG_VALID_NOT_PASS = new ErrorCodeEntry("B31", 400, "参数校验不通过");

	static {
		BASE_ERROR_CODES = Collections.unmodifiableList(ErrorCodeEntry.findStaticErrorCodes(BaseErrorCodes.class));
	}

	private BaseErrorCodes() {
	}

}
